package com.yxtp.controller;

import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;

public class test {

	public static void main(String[] args) {
        Date date = new Date();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        System.out.println(sdf.format(date));
        sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        System.out.println(sdf.format(date));
        sdf = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
        System.out.println(sdf.format(date));
        
        String savePath = "D:/";
        
        SimpleDateFormat sdf2 = new SimpleDateFormat("yyyyMMdd");
        String ymd = sdf2.format(new Date());
        savePath += "/" + ymd + "/";
        File dirFile = new File(savePath);  
        if (!dirFile.exists()) {  
            dirFile.mkdirs();  
        }  
        System.out.println(savePath);
	}
}
